﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using WXWorkSvc.Common.Data;

namespace WXWorkSvc.Areas.Admin.Pages.Corp
{
    public class IndexModel : PageModel
    {
        private readonly WXWorkSvc.Common.Data.WXDbContext _context;

        public IndexModel(WXWorkSvc.Common.Data.WXDbContext context)
        {
            _context = context;
        }

        public IList<TCorp> TCorp { get;set; } = default!;

        public async Task OnGetAsync()
        {
            if (_context.Corps != null)
            {
                TCorp = await _context.Corps.ToListAsync();
            }
        }
    }
}
